import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useModel } from 'umi';

//@ts-ignore
import { moneyFormat, nanoid10 } from '@/utils';
import { msgInfo } from '@/utils/msg';
import { Button, ContextMenu, Tooltip, TreeView } from 'devextreme-react';
import notify from 'devextreme/ui/notify';
import SubjectPopup from '~/public/cpas-business/components-bs/SubjectPopup';
import { LayoutB, LayoutD } from '~/public/cpas-ui/components-bs/Layout';
import DevGrid from '~/public/cpas-ui/components-ui/express-components/DevGrid';
import DevPopup from '~/public/cpas-ui/components-ui/express-components/DevPopup';
import DevToolBar from '~/public/cpas-ui/components-ui/express-components/DevToolBar';
import AccountingVoucherPupop from '../accountingEntryTest/rightTables/components/accountingVoucherPupop';
import PageLoading from '../components/PageLoading';
import { testColumnsZY } from '../SummaryAnalysis/const';
import { getSqlApiList } from '../SummaryAnalysis/server';
import './index.less';
import WordEdit from './WordEdit';
const DoubtCheck = () => {
  const { initialState } = useModel('@@initialState');
  const { dbname, sjxmbh, zcbfid, sjnd, XMType, bsdw, zcbfName } = initialState?.curPart;
  const { username } = initialState?.curUser as API.CurUser;
  const ztModel: any = useModel('ztModel');
  const { ztDates, dataList } = ztModel;
  const dd = dataList.filter((a: any) => a.Data_ID === sjnd);
  const [displaydataId, SetdisplaydataId] = useState<any>(
    dd.length ? dd[0].displayName : `[${sjnd}]${zcbfName}`,
  );
  // const [dataIds, setDataIds] = useState<any[]>();
  const clickTimeoutRef: any = useRef(null); //双击检测
  const clickCountRef = useRef(0);
  const [wordlist, setWordlist] = useState<any[]>([]);
  const [subject, setSubject] = useState<any>('');
  const [CheckWordlist, setCheckWordlist] = useState<any[]>([]);
  const [summary, setSummary] = useState<any[]>();
  const [isDis, setIsDis] = useState(true);

  const contextMenuRef = useRef<any>();
  const contextMenuWordRef = useRef<any>();
  const SubjectRef = useRef<any>();

  const CurrentWord = useRef<any>();
  const InputRefword = useRef<any>();
  const WordlistEditRef = useRef<any>();
  const [CurrentQueryWord, setCurrentQueryWord] = useState<any>(false);
  const [dataId, setDataId] = useState(sjnd);
  const [startMouth, setStartMouth] = useState(`全部`);
  const [endMouth, setEndMouth] = useState(`全部`);
  const [spinLoad, setSpinLoad] = useState(false);
  const Days = useRef([
    '全部',
    ...Array.from(new Array(12), (x, i) => (i <= 8 ? `${sjnd}0${i + 1}` : `${sjnd}${i + 1}`)),
  ]);
  const menuItems = [
    { id: 'edit', text: '编辑' },
    { id: 'deleteCur', text: '删除所选' },
    { id: 'deleteAll', text: '全部清空' },
  ];

  const menuItemsWord = [
    { id: 'addWord', text: '选择为预警词' },
    { id: 'addAllWord', text: '全部选择为预警词' },
    { id: 'ClearAll', text: '清空列表' },
  ];
  useEffect(() => {
    const date = getMonthList(sjnd);
    geth_DoubtfulWord();
  }, []);
  useEffect(() => {
    ztModel.refresh();
  }, []);

  useEffect(() => {
    // setDates(ztDates);
  }, [ztDates]);

  const accountingVoucherPupopRef = useRef<any>(null);

  const toolbarItems = [
    {
      cssClass: 'yd-zt-select-label',
      html: '<span style="font-weight:normal ;font-size: 14px;">账套:  </span>',
      location: 'before',
      // cssClass: 'font',[[]]
    },
    {
      widget: 'dxSelectBox',
      cssClass: 'yd-zt-select',
      options: {
        width: 205,
        items: dataList,
        value: displaydataId,
        valueExpr: 'displayName',
        displayExpr: 'displayName',
        onItemClick: async (e: any) => {
          debugger;
          SetdisplaydataId(e.itemData.displayName);
          setDataId(e.itemData.Data_ID);
          await getMonthList(e.itemData.Data_ID);
        },
      },
      location: 'before',
    },

    {
      cssClass: 'yd-date',
      html: '<span style="font-weight:normal ;font-size: 14px;">月份</span>',
      location: 'before',
    },
    {
      widget: 'dxSelectBox',
      options: {
        // text: "全部科目",
        width: 100,
        value: startMouth,
        items: Days.current,
        onItemClick: function (e: any) {
          setStartMouth(e.itemData);
          if (e.itemData === '全部') {
            setEndMouth('全部');
          } else {
            if (endMouth === '全部' || Number(e.itemData) > Number(endMouth)) {
              setEndMouth(e.itemData);
            }
          }
        },
      },
      location: 'before',
    },
    {
      html: '<span style="font-weight:normal ;font-size: 14px;">至</span>',
      location: 'before',
    },
    {
      widget: 'dxSelectBox',
      options: {
        width: 100,
        value: endMouth,
        items: Days.current,
        onItemClick: function (e: any) {
          // ...
          // ...
          setEndMouth(e.itemData);
          if (e.itemData === '全部') {
            setStartMouth('全部');
          } else {
            if (startMouth === '全部' || Number(e.itemData) < Number(startMouth)) {
              debugger;
              setStartMouth(e.itemData);
            }
          }
        },
      },
      location: 'before',
    },
    {
      widget: 'dxCheckBox',
      location: 'before',
      cssClass: 'yd-date',
      options: {
        text: '全部科目',
        value: isDis,
        onValueChanged: (e: any) => {
          setIsDis(!isDis);
          if (e.value) {
            setSubject('');
          }
        },
      },
    },
    {
      widget: 'dxButton',
      location: 'before',
      options: {
        text: '选择科目',
        disabled: isDis,
        onClick: () => {
          SubjectRef.current.show({
            title: '选择科目',
            dbname: dbname,
            Data_ID: dataId,
            isHasFZZ: false,
            editUser: username,
            // 选择 模式 0：单选 1：多选连机选择
            selectMode: '1',
            //  1：多选连机选择时是否进行递归选择默认是 true
            recursiveMultiple: false,
            // 是否为辅助账
            auxiliaryState: false,
            // 可以选择当前节点的科目
            isSelectSuperior: false,
            // 自动结转科目 默认选中的类型参数
            subjectType: 'periodEarly',
            okCallback: (r: any, v: any) => {
              // 科目审定明细 界面增加一级科目在业务组件 需做更改
              // let kmmcData = v.map((item: any) => item.KMMC);
              // changeData('kmmcStr', kmmcData);
              setSubject(r.KMMC);
            },
          });
        },
      },
    },
    {
      widget: 'dxTextBox',
      options: {
        width: 90,
        readOnly: true,
        value: subject,
      },
      location: 'before',
    },
    {
      widget: 'dxButton',
      cssClass: 'yd-handle-button',
      options: {
        text: '执行批量检查',
        type: 'default',
        disabled: !CheckWordlist.length,
        onClick: async () => {
          setCheckWordlist(
            CheckWordlist?.map((a: any) => {
              if (a.DWord === CurrentQueryWord?.DWord) {
                return { ...a, selected: false };
              } else {
                return a;
              }
            }),
          );
          await getOneZylist({
            Data_ID: dataId,
            startMouth: `${startMouth}`,
            endMouth: `${endMouth}`,
            summary: CheckWordlist.map((a: any) => a.DWord),
            subject: subject,
          });
        },
      },
      location: 'before',
    },
  ];

  const arr_index = (a: any[]) => {
    if (Array.isArray(a)) {
      return a.map((b: any, c: number) => {
        return { ...b, rowid: c };
      });
    } else {
      return [];
    }
  };

  const reFreash = async () => {
    const d = await getSqlApiList('get.h_DoubtfulWord', {
      dbname: dbname,
    });
    if (d.data?.length) {
      return setWordlist(
        arr_index(
          d.data.filter((a: any) => {
            if (CheckWordlist.filter((b: any) => b.DWord === a.DWord).length) {
              return false;
            } else {
              return true;
            }
          }),
        ),
      );
      // return d.data;
    } else {
      setWordlist([]);
      return [];
    }
  };
  const getMonthList = async (Data_ID: string) => {
    const dd: any = await getSqlApiList('account.accountInfo.getMonthList', {
      dbname: dbname,
      Data_ID: Data_ID,
    });
    if (dd.data?.length) {
      const ddcosnt = dd.data.map((a: any) => a.YF).sort((a: any, b: any) => a - b);
      setEndMouth(ddcosnt.at(-1));
      setStartMouth(ddcosnt.at(0));
      Days.current = ['全部', ...ddcosnt];
    } else {
      setEndMouth('');
      setStartMouth('');
      Days.current = [];
    }
  };
  const insertDWord = async (DWord: string) => {
    const dd: any = await getSqlApiList('insert.h_DoubtfulWord', { dbname: dbname, DWord: DWord });
    if (dd.ok) {
      setCheckWordlist(CheckWordlist?.concat({ DWord: DWord }));
      notify('添加成功', 'success', 2000);
    } else {
      notify('添加失败', 'error', 2000);
    }
  };

  const updateDWord = async (DWord: string, id: number, Old_DWord?: string) => {
    const dd: any = await getSqlApiList('update.h_DoubtfulWord', {
      dbname: dbname,
      DWord: DWord,
      id: id,
      Old_DWord: Old_DWord,
    });
    if (dd.ok) {
      notify('修改成功', 'success', 2000);
      return true;
    } else {
      notify('修改失败', 'error', 2000);
      return false;
    }
  };

  const geth_DoubtfulWord = async () => {
    const d = await getSqlApiList('get.h_DoubtfulWord', {
      dbname: dbname,
    });

    if (d.data?.length) {
      setWordlist(arr_index(d.data));
      console.log(arr_index(d.data));
      return arr_index(d.data);
    } else {
      return [];
    }
  };

  const getOneZylist = async (P: {
    Data_ID: string;
    startMouth?: string;
    summary: string[];
    endMouth?: string;
    subject: string;
  }) => {
    debugger;
    let summary = `ZY like '%${P.summary[0]}%'` as string;
    if (P.summary.length > 1) {
      P.summary.forEach((a: any, i: number) => {
        if (i >= 1) {
          summary += `or ZY like '%${a}%'`;
        }
      });
    }
    const subject = P.subject > '' ? `and (KMMC  like '${P.subject}%' )` : '';
    const pzrq =
      P.startMouth?.includes('全部') || P.endMouth?.includes('全部')
        ? ''
        : ` and substring(pzrq,1,6) between '${P.startMouth}' and '${P.endMouth}'`;
    setSpinLoad(true);
    const d = await getSqlApiList('accountingEntryTest.customDefineQuery.getDataList', {
      dbname: dbname,
      Data_ID: P.Data_ID,
      displayOption: false,
      otherWhere: ` and (${summary}) ${pzrq} ${subject}`,
    });
    setSpinLoad(false);
    if (d?.data) {
      // debugger;
      setSummary(d.data);
    } else {
      // debugger;
      setSummary([[]]);
    }
  };

  /**
   *
   * @param e
   * @returns
   */
  const onClickWordListButton = async ({ key }: any) => {
    const datalist = await getSqlApiList('get.h_DoubtfulWord', {
      dbname: dbname,
    });
    // Setbuildkey(nanoid10());
    if (datalist?.data?.length) {
      WordlistEditRef.current.showPop({ words: arr_index(datalist?.data) });
    } else {
      WordlistEditRef.current.showPop({ words: [] });
    }
  };

  /**
   * 待检查框点击疑点词
   * @param param0
   */
  const onClickSelectCheckWord = async ({ itemData }: any) => {
    setCurrentQueryWord(itemData); // 单机选中疑点词，为编辑和查询使用
    setCheckWordlist(
      CheckWordlist?.map((a: any) => {
        if (a.DWord === itemData.DWord) {
          return { ...a, selected: true };
        } else {
          return { ...a, selected: false };
        }
      }),
    );
    clickCountRef.current += 1;
    // 如果有计时器在运行，清除它
    if (clickTimeoutRef.current) {
      clearTimeout(clickTimeoutRef.current);
    }
    if (clickCountRef.current === 2) {
      await getOneZylist({
        Data_ID: dataId,
        startMouth: `${startMouth}`,
        endMouth: `${endMouth}`,
        summary: [itemData.DWord],
        subject: subject,
      });
    }
    // 设置计时器，500ms后重置点击计数
    clickTimeoutRef.current = setTimeout(() => {
      clickCountRef.current = 0;
    }, 500);
  };

  /**
   * 疑点词库双击
   * @param param0
   */
  const onClickDoubleWord = ({ itemData }: any) => {
    clickCountRef.current += 1;
    // 如果有计时器在运行，清除它
    if (clickTimeoutRef.current) {
      clearTimeout(clickTimeoutRef.current);
    }
    if (clickCountRef.current === 2) {
      if (CheckWordlist.filter((a: any) => a.DWord === itemData.DWord).length === 0) {
        setCheckWordlist(CheckWordlist.concat({ DWord: itemData.DWord }));
        setWordlist(wordlist?.filter((a: any) => a.DWord !== itemData.DWord));
      }
    }
    // 设置计时器，500ms后重置点击计数
    clickTimeoutRef.current = setTimeout(() => {
      clickCountRef.current = 0;
    }, 500);
  };

  const onClickRowDbZylist = useCallback(
    ({ data }: any) => {
      let tmepRowData = [{ ...data, Data_ID: dataId, dbname }];
      if (data?.gap > 0) {
        tmepRowData = [
          ...tmepRowData,
          {
            PZBH: data.PZBH_Prior_Org,
            PZLX: data.PZLX_Prior_Org,
            PZRQ: data.PZRQ_Prior_Org,
            Data_ID: sjnd,
            dbname,
          },
        ];
      }
      accountingVoucherPupopRef.current.showPupop(
        { ...data, Data_ID: dataId, dbname },
        tmepRowData,
      );
    },
    [dataId],
  );

  const onClickSelectAll = () => {
    if (wordlist?.length) {
      setCheckWordlist(CheckWordlist.concat(wordlist));
      setWordlist([]);
    }
  };

  const OnClickaddWord = (tit = '增加疑点词') => {
    debugger;
    InputRefword.current.show({
      title: tit,
      okCallback: async (v: any) => {
        // console.log(v, 'v------');

        if (tit === '增加疑点词') {
          await insertDWord(v);
        } else {
          const res = await updateDWord(v, -1, CurrentQueryWord?.DWord);
          if (res) {
            setCurrentQueryWord({ ...CurrentQueryWord, DWord: v });
            setCheckWordlist(
              CheckWordlist?.map((a: any) => {
                if (a.DWord === CurrentQueryWord?.DWord) {
                  return { ...a, DWord: v };
                } else {
                  return a;
                }
              }),
            );
          }
        }
      },
      regExpFunc: (v: any) => {
        if (v?.trim() === '') {
          notify('请输入内容', 'warning', 2000);
          return false;
        }
        if (
          wordlist?.filter((a: any) => a.DWord === v).length ||
          CheckWordlist?.filter((a: any) => a.DWord === v).length
        ) {
          notify('输入的字词已经存在了', 'error', 2000);
          return false;
        } else {
          return true;
        }
      },
      value: tit === '增加疑点词' ? '' : CurrentQueryWord?.DWord,
    });
  };
  function contextMenu(e: any) {
    const { column, row, columnIndex, rowIndex } = e;
    const { dataField, dataType } = column;
    const defaultMenu = [
      {
        text: '添加自单选项',
        onItemClick: () => {
          alert(dataField);
        },
      },
    ];
    return defaultMenu;
  }

  const contextMenuItemClickWord = (
    e: ContextMenuTypes.ItemClickEvent & { itemData: { id?: any } },
  ) => {
    switch (e.itemData.id) {
      case 'ClearAll': {
        setWordlist([]);
        break;
      }
      case 'addAllWord': {
        onClickSelectAll();
        break;
      }
      case 'addWord': {
        setCheckWordlist(CheckWordlist.concat({ DWord: CurrentWord.current }));
        setWordlist(wordlist?.filter((a: any) => a.DWord !== CurrentWord.current));
        break;
      }
    }
  };
  const contextMenuItemClick = useCallback(
    async (e: ContextMenuTypes.ItemClickEvent & { itemData: { id?: any } }) => {
      debugger;
      switch (e.itemData.id) {
        case 'deleteAll': {
          setCheckWordlist([]);
          setSummary([]);
          setCurrentQueryWord(false);
          // await reFreash();
          setWordlist(wordlist.concat(CheckWordlist));
          break;
        }
        case 'deleteCur': {
          if (CurrentQueryWord) {
            // debugger;
            setCheckWordlist(CheckWordlist.filter((a: any) => a.DWord !== CurrentQueryWord.DWord));
            setCurrentQueryWord(false);
            // await reFreash();
            setWordlist(wordlist.concat({ DWord: CurrentQueryWord.DWord }));
          }
          break;
        }
        case 'edit': {
          await OnClickaddWord('编辑关键词');
          break;
        }
      }
    },
    [CurrentQueryWord],
  );
  const treeViewItemContextMenu = (
    e: TreeViewTypes.ItemContextMenuEvent & { itemData: { DWord: any; id: any } },
  ) => {
    debugger;
    if (CheckWordlist.length === 0) {
      // 没有项目时无法右键
      contextMenuRef.current?.instance?.option('items[1].visible', false);
      contextMenuRef.current?.instance?.option('items[2].visible', false);
      contextMenuRef.current?.instance?.option('items[3].visible', false);
    } else {
      setCheckWordlist(
        CheckWordlist?.map((a: any) => {
          if (a.DWord === e.itemData.DWord) {
            return { ...a, selected: true };
          } else {
            return { ...a, selected: false };
          }
        }),
      );
      if (CurrentQueryWord) {
        setCurrentQueryWord({ ...CurrentQueryWord, DWord: e.itemData.DWord, id: e.itemData.id });
      } else {
        setCurrentQueryWord(e.itemData);
      }
    }
  };

  const treeViewItemContextWorMenu = (
    e: TreeViewTypes.ItemContextMenuEvent & { itemData: { DWord: any; id: any } },
  ) => {
    if (wordlist?.length === 0) {
      contextMenuWordRef.current?.instance?.option('items[1].visible', false);
      contextMenuWordRef.current?.instance?.option('items[1].visible', false);
      contextMenuWordRef.current?.instance?.option('items[1].visible', false);
    } else {
      CurrentWord.current = e.itemData.DWord;
    }
  };
  const WordTreeView = useMemo(
    () => (
      <TreeView
        id="dataGrid11"
        height={'100%'}
        width={'100%'}
        dataSource={CheckWordlist}
        displayExpr="DWord"
        // className="BoderWord"
        noDataText={''}
        keyExpr={'DWord'}
        activeStateEnabled={true}
        hoverStateEnabled={true}
        focusStateEnabled={true}
        // selectedExpr={}
        // itemRender={({ DWord }: any) => {
        //   return <>{DWord}</>;
        // }}
        onItemContextMenu={treeViewItemContextMenu}
        onItemClick={onClickSelectCheckWord}
      />
    ),
    [CurrentQueryWord, CheckWordlist],
  );
  function topContainer() {
    return (
      <>
        <div
          style={{
            height: '29px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            margin: 5,
          }}
        >
          <span> 待查预警字词(双击检查)</span>

          <Button
            icon={'add'}
            id="addHoverButton"
            className={'yd-fix-icon-center'}
            stylingMode="contained"
            onClick={() => {
              OnClickaddWord();
            }}
            width={30}
          />
        </div>
        <div
          className={'tree-container-border'}
          style={{ height: 'calc(100% - 38px)', width: 'calc(100% - 5px)' }}
        >
          {WordTreeView}
          <ContextMenu
            ref={contextMenuRef}
            dataSource={menuItems}
            target="#dataGrid11 .dx-treeview-item"
            onItemClick={contextMenuItemClick}
          />
        </div>
      </>
    );
  }
  function bottomContainer() {
    return (
      <>
        <div
          style={{
            minHeight: '29px',
            marginTop: '10px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            paddingTop: 8,
            margin: 5,
          }}
        >
          <span> 疑点字词库(双击选择)</span>
          <Button
            id="hoverButton"
            icon={'check'}
            className={'yd-fix-icon-center'}
            onClick={onClickSelectAll}
            width={30}
            stylingMode="contained"
            text="全选"
          />
        </div>
        <div
          className={'tree-container-border'}
          style={{ height: 'calc(100% - 80px )', width: 'calc(100% - 5px)' }}
        >
          <TreeView
            id="data1Grid"
            height={'100%'}
            width={'100%'}
            dataSource={wordlist}
            displayExpr={'DWord'}
            keyExpr={'DWord'}
            // className="BoderWord"
            noDataText={''}
            onItemClick={onClickDoubleWord}
            onItemContextMenu={treeViewItemContextWorMenu}
          />
          <ContextMenu
            ref={contextMenuWordRef}
            dataSource={menuItemsWord}
            target="#data1Grid .dx-treeview-item"
            onItemClick={contextMenuItemClickWord}
          />
        </div>
        <div className={'bottom-fix'}>
          <div
            style={{
              minHeight: '35px',
              display: 'flex',
              alignItems: 'center',
              position: 'relative',
              top: 1,
              justifyContent: 'space-between',
            }}
          >
            <Button onClick={reFreash} text="刷新" width={110} height={'30px'} />
            <Button
              onClick={onClickWordListButton}
              width={120}
              style={{ marginRight: 6 }}
              text="疑点字词维护"
              height={'30px'}
            />
          </div>
        </div>
      </>
    );
  }
  function leftContainer() {
    return (
      <div style={{ height: 'calc(100%  - 10px) ' }} className="defineButton">
        <LayoutD topSlot={topContainer()} bottomSlot={bottomContainer()} />
      </div>
    );
  }

  const rightContainer = useMemo(() => {
    return (
      <div
        style={{
          padding: '0px 4px',
          height: 'calc(100%  - 10px) ',
          width: '100%',
          overflowX: 'scroll',
        }}
      >
        <DevGrid.RangeTap
          key={nanoid10()}
          dataSource={summary}
          excelName="疑点分析"
          id={'yd-right-grid'}
          keyExpr="FLID"
          height={'100%'}
          width={'100%'}
          ContextMenu={contextMenu}
          defaultColumns={testColumnsZY}
          allowColumnResizing={true}
          scrolling={{
            mode: 'virtual',
            rowRenderingMode: 'virtual',
            renderAsync: true,
          }}
          showBorders={true}
          paging={{
            pageSize: 0,
          }}
          summary={{
            totalItems: [
              {
                column: 'PZRQ',
                customizeText: (a: any) => `总计：${a.value}`,
                summaryType: 'count',
                cssClass: 'zyfontColor',
              },
              {
                column: 'JFJE',
                summaryType: 'sum',
                name: 'ww',
                // caption: '贷方比重(%)',
                skipEmptyValues: true,
                // valueFormat: 'currency',
                customizeText: (a: any) => moneyFormat(Number(a.value)),
                cssClass: 'zyfontColor',
              },

              {
                column: 'DFJE',
                summaryType: 'sum',
                customizeText: (a: any) => moneyFormat(Number(a.value)),
                cssClass: 'zyfontColor',
              },
            ],
          }}
          onRowDblClick={onClickRowDbZylist}
        />
      </div>
    );
  }, [onClickRowDbZylist, summary]);

  return (
    <>
      <Tooltip
        target="#hoverButton"
        showEvent="mouseenter"
        hideEvent="mouseleave"
        // closeOnOutsideClick={false}
        contentRender={() => <div>全选</div>}
      />
      <Tooltip
        target="#addHoverButton"
        showEvent="mouseenter"
        hideEvent="mouseleave"
        // closeOnOutsideClick={false}
        contentRender={() => <div>增加</div>}
      />
      <SubjectPopup ref={SubjectRef} />
      <AccountingVoucherPupop
        ref={accountingVoucherPupopRef}
        cellDblClickCallback={(rowData: any, curYear: any) => {
          msgInfo(`正在打开 明细账,请稍候...`);
          if (window.electronComponents) {
            const sessionParams = JSON.parse(window.sessionStorage.electronParams);
            const { sjxmbh, ZcbfID } = sessionParams.params;
            window.location.href = `cpas://OpenLocalFile/?fileName={UFCPAS4_PATH}/UFCPAS4.exe&params=UserCode={UserCode} UserPwd={UserPwd} ProjectCode=${sjxmbh} ZcbfID=${ZcbfID} Functions=FM_103 FunParameters="Data_ID=${curYear},KMBH=${rowData.KMBH}"`;
          } else {
            console.error('window["electronComponents"] false');
          }
        }}
      />
      <DevPopup.Input ref={InputRefword} />
      <WordEdit ref={WordlistEditRef} reFreash={reFreash} />
      <div style={{ height: '100%', minWidth: '1123px' }}>
        <PageLoading isOpen={spinLoad} isMaskClose={false} content={'正在加载...'} width={200} />
        <DevToolBar.Default items={toolbarItems} style={{ padding: '8px 0', minWidthl: '100%' }} />
        <div
          style={{
            height: 'calc(100% - 50px)',
            backgroundColor: 'rgba(244, 242, 239, 0.5)',
            width: '100%',
          }}
          className="word"
        >
          <LayoutB
            rowSize={['10%', '250px', '70%']}
            leftSlot={leftContainer()}
            rightSlot={rightContainer}
          />
        </div>
      </div>
    </>
  );
};

export default DoubtCheck;
